{* $Id$ *}
{include_core file="admin/lib/header.html" title="销售数据"}
<div class="page-header border-bottom clearfix">
    <h2 class="left">销售数据<span>搜索查看对应时间段全国所有省相关信息</span></h2>
</div>
<div class="search-form js_advancedForm">
    <form action="{AnUrl('records_center/admin/region')}" method="get">
        <p>
            <label for="" class="search-f-label">地区：</label>
        </p>
        <div class="search-f-map search-f-map-province">
            <label class="label label-default"><input class="select-all" type="checkbox">全选</label>
            {if !isset($PROVINCE_INDEX)}
            {$PROVINCE_INDEX = area_helper::province_index()}
            {/if}
            {if !isset($search_filter)}
            {$search_filter = URLTracker::val('search_filter')}
            {/if}
            {foreach $PROVINCE_INDEX as $code => $item}
            <label class="label label-normal"><input value="{$code}" name="search_filter[province_id][]" type="checkbox"
                                                     {if in_array($code, $search_filter.province_id)}
                                                     checked="checked" {/if}>{$item.shortname}</label>
            {/foreach}
        </div>
        <p class="js-time-range-check">
            <label for="" class="search-f-label">时间：</label>
            <input type="text" class="search-f-ipt1 search-f-ipt2 js-date-picker js-start-time"
                   name="search_filter[start_date]"
                   value="{URLTracker::val('search_filter', 'start_date')}">
            <span class="search-f-line"></span>
            <input type="text" class="search-f-ipt1 search-f-ipt2 js-date-picker js-end-time"
                   name="search_filter[end_date]"
                   value="{URLTracker::val('search_filter', 'end_date')}">
        </p>
        <p>
            <label for="" class="search-f-label"></label>
            <button type="submit" class="btn btn-success btn-xs js_searchBtn">搜索</button>
        </p>
    </form>
</div>
<!--start:横表-->
<table class="column-table">
    <tbody>
    <tr>
        <td>
            <span>下过单的合伙人: </span><span>{$totals.agency}</span>
        </td>
        <td>
            <span>订单总数: </span><span>{$totals.order}</span>
        </td>
        <td>
            <span>出货量汇总: </span><span>{$totals.num}</span>
        </td>
        <td>
            <span>销售额汇总: </span><span>{$totals.price}</span>
        </td>
    </tr>
    </tbody>
</table>
<!--end:横表-->
<p>&nbsp;</p>
<!--start:列表-->
<table class="list-table list-table-sort">
    <thead>
    <tr>
        <th class="no-sort">地区</th>
        <th data-sort-type="int" style="text-align: right">下过单的合伙人</th>
        <th data-sort-type="int" style="text-align: right">订单数</th>
        <th data-sort-type="int" style="text-align: right">出货量</th>
        <th data-sort-type="float" style="text-align: right">销售额</th>
    </tr>
    </thead>
    <tbody>
    {URLTracker::del('search_filter', 'province_id')}
    {foreach $data as $k => $v}
    <td>
        {if $v.province_code}
        <a href="{AnUrl('records_center/admin/region/province')}?search_filter%5Bprovince_id%5D%5B%5D={$v.province_code}&{URLTracker::parse()}">{$v.area}</a>
        {else}
        {$v.area}
        {/if}
    </td>
    <td style="text-align: right">{$v.count_agency_id}</td>
    <td style="text-align: right">{$v.count_order_id}</td>
    <td style="text-align: right">{$v.sum_num}</td>
    <td style="text-align: right">{$v.sum_price}</td>
    </tr>
    {foreachelse}
    <tr>
        <td class="txtleft" colspan="8">暂无数据</td>
    </tr>
    {/foreach}
    </tbody>
</table>
<!--end:列表-->
{load_js file="module/search_f_map.js"}
{include_core file="module/list_table_sort.html"}
{include_core file="module/search_form_check.html"}
{include_core file="admin/lib/footer.html"}
<!--全选js-->
